package org.darkforest.model;

import org.darkforest.common.util.Page;
import org.darkforest.enums.CharNumberEnum;
import org.darkforest.enums.SettingNameEnum;
import org.darkforest.enums.ShoppingGroupEnum;

import java.math.BigDecimal;

public class ShoppingGroup extends Page<ShoppingGroup> {

    private Integer id;

    private String activeName;

    private Integer activeGoodsId;

    private String activeGoodsName;

    private BigDecimal activeGoodsPrice;

    private BigDecimal activePrice;

    private Integer activeState;

    private Integer activeMemberLimit;

    private Integer activeMemberNum;

    private Float activeGiftRate;

    private String activeDescript;

    private String activePublishTime;

    private String activeLotteryTime;

    private Integer activeWinner;

    private Integer activeOrderId;

    private Integer activeCircleNum;

    private Integer activeCircleLimit;

    private String activeEndTime;

    private String activeImage;

    private GoodsCommonWithBLOBs goods;


    /**
     * 获取当前轮数字符
     * @return
     */
    public String getCircleChar(){
        return CharNumberEnum.getTextByValue(this.getActiveCircleNum());
    }


    /**
     * 获取本轮 参与人数的百分比
     * @return
     */
    public String getJoinRate(){
        return new BigDecimal(this.getActiveMemberNum()%this.getActiveMemberLimit()).divide(new BigDecimal(this.getActiveMemberLimit()),4,BigDecimal.ROUND_DOWN).multiply(new BigDecimal(100)).setScale(2).toString();
    }



    public GoodsCommonWithBLOBs getGoods() {
        return goods;
    }

    public void setGoods(GoodsCommonWithBLOBs goods) {
        this.goods = goods;
    }

    public String getActiveStateStr(){
        return ShoppingGroupEnum.getTextByValue(this.getActiveState());
    }



    public String getActiveGoodsName() {
        return activeGoodsName;
    }

    public void setActiveGoodsName(String activeGoodsName) {
        this.activeGoodsName = activeGoodsName;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getActiveName() {
        return activeName;
    }

    public void setActiveName(String activeName) {
        this.activeName = activeName;
    }

    public Integer getActiveGoodsId() {
        return activeGoodsId;
    }

    public void setActiveGoodsId(Integer activeGoodsId) {
        this.activeGoodsId = activeGoodsId;
    }

    public BigDecimal getActiveGoodsPrice() {
        return activeGoodsPrice;
    }

    public void setActiveGoodsPrice(BigDecimal activeGoodsPrice) {
        this.activeGoodsPrice = activeGoodsPrice;
    }

    public BigDecimal getActivePrice() {
        return activePrice;
    }

    public void setActivePrice(BigDecimal activePrice) {
        this.activePrice = activePrice;
    }

    public Integer getActiveState() {
        return activeState;
    }

    public void setActiveState(Integer activeState) {
        this.activeState = activeState;
    }

    public Integer getActiveMemberLimit() {
        return activeMemberLimit;
    }

    public void setActiveMemberLimit(Integer activeMemberLimit) {
        this.activeMemberLimit = activeMemberLimit;
    }

    public Integer getActiveMemberNum() {
        return activeMemberNum;
    }

    public void setActiveMemberNum(Integer activeMemberNum) {
        this.activeMemberNum = activeMemberNum;
    }

    public Float getActiveGiftRate() {
        return activeGiftRate;
    }

    public void setActiveGiftRate(Float activeGiftRate) {
        this.activeGiftRate = activeGiftRate;
    }

    public String getActiveDescript() {
        return activeDescript;
    }

    public void setActiveDescript(String activeDescript) {
        this.activeDescript = activeDescript == null ? null : activeDescript.trim();
    }

    public String getActivePublishTime() {
        return activePublishTime;
    }

    public void setActivePublishTime(String activePublishTime) {
        this.activePublishTime = activePublishTime == null ? null : activePublishTime.trim();
    }

    public String getActiveLotteryTime() {
        return activeLotteryTime;
    }

    public void setActiveLotteryTime(String activeLotteryTime) {
        this.activeLotteryTime = activeLotteryTime == null ? null : activeLotteryTime.trim();
    }

    public Integer getActiveWinner() {
        return activeWinner;
    }

    public void setActiveWinner(Integer activeWinner) {
        this.activeWinner = activeWinner;
    }

    public Integer getActiveOrderId() {
        return activeOrderId;
    }

    public void setActiveOrderId(Integer activeOrderId) {
        this.activeOrderId = activeOrderId;
    }

    public Integer getActiveCircleNum() {
        return activeCircleNum;
    }

    public void setActiveCircleNum(Integer activeCircleNum) {
        this.activeCircleNum = activeCircleNum;
    }

    public Integer getActiveCircleLimit() {
        return activeCircleLimit;
    }

    public void setActiveCircleLimit(Integer activeCircleLimit) {
        this.activeCircleLimit = activeCircleLimit;
    }

    public String getActiveEndTime() {
        return activeEndTime;
    }

    public void setActiveEndTime(String activeEndTime) {
        this.activeEndTime = activeEndTime == null ? null : activeEndTime.trim();
    }

    public String getActiveImage() {
        return activeImage;
    }

    public void setActiveImage(String activeImage) {
        this.activeImage = activeImage == null ? null : activeImage.trim();
    }
}